package service.outputDocument;

import model.Blocks;

import java.io.File;
import java.io.IOException;
import java.util.List;


public class DocumentCreator {
    private Blocks blocks;
    private File file;
    // TODO: 17-10-5 接受数据

    public DocumentCreator(Blocks blocks,File file) {
        this.blocks = blocks;
        this.file = file;
    }

    public void createWord() throws IOException {
        // TODO: 17-10-5 分析数据
        DataAnalyst analyst = new DataAnalyst(blocks);
        List contentPos =analyst.analysisData();
        // TODO: 17-10-5 处理数据
        DataProcessor processor = new DataProcessor(blocks,contentPos);
        List content = processor.processData();
        // TODO: 17-10-5 输出Word(2007+)文档
        WordWriter writer = new WordWriter(content,file);
        writer.creatWord();
    }
}
